#include <bits/stdc++.h>
#define rep(i,l,r) for (int i = l; i <= r; i ++)
#define per(i,r,l) for (int i = r; i >= l; i --)
using namespace std;
const int MN = 1e6 + 5;
#define ll long long
int T,opt,n;
int Seq[MN],S[MN],Pre[MN];
inline void Solve () {
	int l = 1,r = n * 2;
	while (l < r && S[l] == S[r]) l ++,r --;
	if (l > r) {
		if (opt) return ;
		rep (i,1,2 * n) if (Pre[i]) cout << 'R'; else cout << 'L';
		opt = 1;
	}
}
inline void Dfs (int x,int l,int r) {
	if (opt) return ;
	if (x == 2 * n + 1) {
		Solve (); return ;
	}
	if (opt) return ;
	S[x] = Seq[l],Pre[x] = 0,Dfs (x + 1,l + 1,r);
	S[x] = Seq[r],Pre[x] = 1,Dfs (x + 1,l,r - 1);
	return ;
}
int main () {
	freopen ("palin.in","r",stdin);
	freopen ("palin.out","w",stdout);
	scanf ("%d",&T);
	while (T --) {
		opt = 0; scanf ("%d",&n);
		rep (i,1,2 * n) scanf ("%d",&Seq[i]);
		Dfs (1,1,2 * n); if (! opt) cout << -1; cout <<endl;
	}
	return 0;
}
/*2
5 
4 1 2 4 5 3 1 2 3 5*/
